<template>
	<view class="emergencyOrder">
		<view class="emergencyOrder_box">
			<OrderDetail :param="'emergency'" :orderInfo="infoDetail" :emergenceInfo="httpParams"
				@updateOrderInfo='updateOrderInfo'>
			</OrderDetail>
		</view>
	</view>
</template>

<script>
	import {
	
		WORK_CONTROLLER
	} from "../../api/pms";
	import OrderDetail from '../../pages/productCenter/workDetail.vue'
	
	export default {
		name: "faultOrder",
		props: ["httpParams"],
		components: {
			OrderDetail
		},
		data() {
			return {
				infoDetail: {
					woSn:''
				
				},
				orderInfoGlobal: {},
				contactPhoneSpecial: [],
				contactUserSpecial: []
			};
		},
		created() {
			this.getWosn();
		},
		methods: {
			getWosn(){
				let faultId = this.httpParams.faultId || '';
				let params = {
				     emergencyId:faultId,
					 pageNum:1,
					 pageSize:10
				};
				this.fetch('get', this.$store.state.baseUrl + WORK_CONTROLLER.GET_ALL_WORKORDER_LIST, params, true)
					.then((res) => {
						if (res.success && res.data && res.data.content&&res.data.content.length) {
							this.infoDetail.woSn = res.data.content[0].woSn
						} else {
							console.error(res)
						}
					})
		
			},
			back() {
				uni.navigateBack();
			},
			
		}
	}
</script>

<style scoped lang="less">
	.emergencyOrder {
		padding: 10rpx 10rpx;
		background: #FFFFFF;
		border-radius: 10px;
		height: calc(100vh - 254rpx);
	}

	.emergencyOrder_box {
		height: 100%;
	}

	.detail {
	
	}
</style>